﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace TestAngular.Migrations
{
    public partial class Staff_Department_UpdateParentId : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_BasicArchivesBillOfMaterials_BasicArchivesBillOfMaterials_BillOfMaterialsId",
                table: "BasicArchivesBillOfMaterials");

            migrationBuilder.DropForeignKey(
                name: "FK_BasicArchivesDepartment_BasicArchivesDepartment_DepartmentId",
                table: "BasicArchivesDepartment");

            migrationBuilder.DropIndex(
                name: "IX_BasicArchivesDepartment_DepartmentId",
                table: "BasicArchivesDepartment");

            migrationBuilder.DropIndex(
                name: "IX_BasicArchivesBillOfMaterials_BillOfMaterialsId",
                table: "BasicArchivesBillOfMaterials");

            migrationBuilder.DropColumn(
                name: "DepartmentId",
                table: "BasicArchivesDepartment");

            migrationBuilder.DropColumn(
                name: "BillOfMaterialsId",
                table: "BasicArchivesBillOfMaterials");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<Guid>(
                name: "DepartmentId",
                table: "BasicArchivesDepartment",
                type: "uniqueidentifier",
                nullable: true);

            migrationBuilder.AddColumn<Guid>(
                name: "BillOfMaterialsId",
                table: "BasicArchivesBillOfMaterials",
                type: "uniqueidentifier",
                nullable: true);

            migrationBuilder.CreateIndex(
                name: "IX_BasicArchivesDepartment_DepartmentId",
                table: "BasicArchivesDepartment",
                column: "DepartmentId");

            migrationBuilder.CreateIndex(
                name: "IX_BasicArchivesBillOfMaterials_BillOfMaterialsId",
                table: "BasicArchivesBillOfMaterials",
                column: "BillOfMaterialsId");

            migrationBuilder.AddForeignKey(
                name: "FK_BasicArchivesBillOfMaterials_BasicArchivesBillOfMaterials_BillOfMaterialsId",
                table: "BasicArchivesBillOfMaterials",
                column: "BillOfMaterialsId",
                principalTable: "BasicArchivesBillOfMaterials",
                principalColumn: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_BasicArchivesDepartment_BasicArchivesDepartment_DepartmentId",
                table: "BasicArchivesDepartment",
                column: "DepartmentId",
                principalTable: "BasicArchivesDepartment",
                principalColumn: "Id");
        }
    }
}
